package jk.spider.core.throttle.impl;

import jk.spider.core.throttle.Throttle;
import jk.spider.core.throttle.ThrottleProvider;
import jk.spider.util.config.PropertySet;

public class SimultaneousUsersThrottleProvider implements ThrottleProvider {

	public static final String THINKTIME_MIN = "thinktime.min";
	public static final String THINKTIME_MAX = "thinktime.max";

	public static final int THINKTIME_MIN_DEFAULT = 1000;
	public static final int THINKTIME_MAX_DEFAULT = 1000;

	public Throttle createThrottle(PropertySet props) {
		int min = props.getInteger(THINKTIME_MIN, THINKTIME_MIN_DEFAULT);
		int max = props.getInteger(THINKTIME_MAX, THINKTIME_MAX_DEFAULT);
		return new SimultaneousUsersThrottleImpl(min, max);
	}

}
